<template>
  <div id="micro-app" class="dog">
    <router-view/>
    <Login />
  </div>
</template>

<script>
import ds from '@/service/components/ds'
import ebus from '@/components/ebus'
import Login from '@/components/login/login.vue'

export default {
  name: 'App',

  components: {
    Login
  },

  created () {
    ds.$on('onAfterRequest', (result) => {
      let options = result.options
      if (
        result && result.response &&
        String(result.response.status) === '403'
      ) {
        // 弹出窗口
        ebus.$emit('onShowLogin')
        // 登录超时
        ebus.$emit('onLoginExpire')
      } else if (
        result && result.response &&
        String(result.response.status) === '401'
      ) {
        // 弹出窗口
        this.$message({
          message: '暂无权限进行此操作',
          type: 'error'
        })
      } else {
        if (options.isShowError !== false) {

        }
      }
    })
  },

  mounted () {
    let lm = document.querySelector('.d-loading-maker')
    lm && (lm.style.display = 'none')
  }
}
</script>

<style lang="less">
body {
  margin: 0;
  padding: 0;
}
@media(max-width: 756px) {
  ::-webkit-scrollbar {
    display: none!important;
    width: 0px;  
    height: 0px;  
  }
}
.d-header-container {
  justify-content: space-between;
}
.layout-body-page {
  & > .d-layout-content {
    margin: 0 auto;
    // max-width: 1200px;
  }
}
.d-layout-header {
  position: relative;
  z-index: 5;
}
.layout-content {
  min-height: calc(100vh - 48px - 32px - 38px - 8px - 16px);
}
.d-table-tr {
  .d-grid-actions {
    .d-text-theme {
      color: #999;
    }
  }
  &:hover {
    .d-grid-actions {
      .d-text-theme {
        color: #3391ff;
      }
    }
  }
}
.d-layout-content {
  & > .d-contenter {
    display: flex;
    min-height: 100%;
    .paner-list {
      display: flex;
      flex-direction: column;
      flex: 1;
      & > .d-paner-table {
        flex: 1;
        & > .d-paner-body {
          flex: 1;
        }
      }
    }
    & > .d-paner {
      flex: 1;
    }
  }
}
.d-layout-content .d-contenter {
  .d-box-building {
    margin-top: 64px
  }
}
@media (max-width: 1380px) {
  .d-nav-bar {
    flex: 1;
  }
  .navbar-toggle {
    display: block !important;
  }
  .nav-bar-group {
    display: none;
  }
}
</style>
